#ifndef WorldTcpSerProc_H
#define WorldTcpSerProc_H

#include <QtNetwork>
#include <QObject>

class WorldTcpSerProc : public  QObject
{
    Q_OBJECT
public:
    WorldTcpSerProc();
    ~WorldTcpSerProc();
    static WorldTcpSerProc* instance()
    {
        static WorldTcpSerProc instance;
        return &instance;
    }
    bool DoStart(QString ChoiceIp, quint16 LocalPort, quint16 FdPort);

    void DoStop();

    bool IsForwardStart() { return (IsSerStart && ConnectClients.count() > 0); }

    QList<QTcpSocket*> ConnectClients;

public slots:
    void AcceptConnect();
    void RemoveProcClient();
private:
    QTcpServer *WorldTcpServer;
    bool IsSerStart;
    QString ForwardIp;
    quint16 ForwardPort;

#define sWorldTcpSerProc WorldTcpSerProc::instance()
};

#endif
